<?php

class NoBusinessBase_Controller_Oslc_Catalog extends NoBusinessBase_Controller_Oslc_ActionBase
{
   public function init()
   {
      parent::init();
   }
   
   public function createServiceProviderCatalog($title = '')
   {
      $rdf = $this->_dom->createElement('rdf:RDF');
      $this->attrAppend($rdf, 'xmlns:rdf');
      $this->attrAppend($rdf, 'xmlns:dc');
      $this->attrAppend($rdf, 'xmlns:oslc');
      
      $serviceProviderCatalog = $this->_dom->createElement('oslc:ServiceProviderCatalog');
      $rdf->appendChild($serviceProviderCatalog);
      
      $this->attrAppend($serviceProviderCatalog, 'rdf:about');
      $serviceProviderCatalog->appendChild($this->_dom->createElement('dc:title', $title));

      $this->_nextAppendToElement->appendChild($rdf);
      $this->_serviceProviderCatalogElement = $serviceProviderCatalog;
      
      $this->_nextAppendToElement = $this->_serviceProviderCatalogElement;
      return $rdf;
   }
   
   public function createServiceProviderElement($title, $servicesUri)
   {
      $pEntryElement             = $this->_dom->createElement('oslc:serviceProvider');
      $pServiceProviderElement   = $this->_dom->createElement('oslc:ServiceProvider');
      $pEntryElement->appendChild($pServiceProviderElement);
      $this->attrAppend($pServiceProviderElement, 'rdf:about', $servicesUri);
      
      $pServiceProviderElement->appendChild($this->_dom->createElement('dc:title', $title));
      
      $this->_nextAppendToElement->appendChild($pEntryElement);
   }
}
